insert overwrite table jms_ods.tab_barscan_send_image partition(dt = '{{ execution_date | cst_ds }}')
select
recordid
,billcode
,listcode
,subbillcode
,transfercode
,packagecode
,scantype
,nextstation
,destination
,scanuser
,inputsite
,scantime
,inputtime
,operatedate
,send_deliver_user
,sendcustomer
,sendsite
,destsite
,transfercenter
,pcs
,weight
,goodstype
,expresstype
,shifts
,transfer_deliver_fee
,networkfee
,otherfee
,checkflag
,accountflag
,receiptflag
,returnflag
,elescaleflag
,unrecordflag
,writebackflag
,lockflag
,remark
,modifyuser
,modifytime
,mobile
,pistolid
,remark1
,remark2
,scansitecode
,uploadtime
,remark3
,scanusercode
,send_deliver_usercode
,nextstationcode
,source
,remark5
,remark6
,remark4
,scansiteid
,nextstationid
,scanuserid
,send_deliver_userid
from jms_ods.tab_barscan_send_real_time where  dt between date_add('{{ execution_date | cst_ds }}', -1) and '{{ execution_date | cst_ds }}'
 and date_format(inputtime,'yyyy-MM-dd HH') > concat(date_add('{{ execution_date | cst_ds }}', -1), ' 22')
 and to_date(inputtime) < date_add('{{ execution_date | cst_ds }}', 1);